# Maintainer: Florian Pritz <bluewind@xinu.at>

_name=schema
pkgname="python-$_name"
pkgver=0.7.5
pkgrel=3
pkgdesc='Python module to validate and convert data structures.'
arch=(any)
url="https://github.com/keleshev/$_name"
depends=(python python-contextlib2)
makedepends=(python-setuptools)
checkdepends=(python-mock python-pytest)
license=(MIT)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha256sums=('f06717112c61895cabc4707752b88716e8420a8819d71404501e114f91043197')

prepare() {
  cd "$srcdir/$_name-$pkgver"
  # accept arbitrary versions
  sed 's|==|>=|g' -i requirements.txt
}

build() {
  cd "$srcdir/$_name-$pkgver"
  python setup.py build
}

check() {
  cd "$srcdir/$_name-$pkgver"
  pytest
}

package() {
  cd "$srcdir/$_name-$pkgver"
  python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
  install -D -m644 LICENSE-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim: ts=2 sw=2 et:
